#pragma once

#include <QWidget>
#include <QtCharts/QChartView>
#include <QtCharts/QStackedBarSeries>
#include <QtCharts/QBarSet>
#include <QtCharts/QBarCategoryAxis>
#include <QtCharts/QValueAxis>
#include "util/serverhelper.h"
#include "util/usermanager.h"

namespace Ui {
class DataPage;
}

QT_CHARTS_USE_NAMESPACE

namespace WordMemory
{
    class DataPage : public QWidget
    {
        Q_OBJECT

    public:
        explicit DataPage(QWidget *parent = nullptr);
        ~DataPage();
        void refreshPageData();

    private:
        void setupConnections();
        void fetchDailyStats();
        void displayDailyStatsChart(const QJsonArray &dailyData);

        Ui::DataPage *ui;
        ServerHelper* serverhelper;
        QChart *m_chart;
    };
}
